package com.wrl.mmall.service;

import com.wrl.mmall.common.ServerResponse;
import com.wrl.mmall.vo.OrderVo;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public interface IOrderService {
    //支付
    ServerResponse pay(Long orderNo, Integer userId, String path);
    //支付宝回调
    ServerResponse aliCallback(Map<String , String> params);
    //查询订单支付状态
    ServerResponse queryOrderPayStatus(Integer userId, Long orderNo);
    //创建订单
    ServerResponse create(Integer userId, Integer shippingId);
    //取消订单
    ServerResponse cancel(Integer userId, Long orderNo);
    //查询一个订单的所有商品item
    ServerResponse getOrderCartProduct(Integer userId);
    //订单详情
    ServerResponse getOrderDetail(Integer userId, Long orderNo);
    //查看当前登录用户的所有订单
    ServerResponse getOrderList(Integer id, int pageNum, int pageSize);

    /* backend */
    //后台获取订单list
    ServerResponse<PageInfo> getManageList(int pageNum, int pageSize);
    //后台获取订单详情
    ServerResponse<OrderVo> getManageDetail(Long orderNo);
    //按订单查询（不过要为以后模糊查询做准备）
    ServerResponse<PageInfo> getOrderSearch(Long orderNo, int pageNum, int pageSize);
    //后台发货
    ServerResponse<String> orderSendGoods(Long orderNo);

    //关闭订单
    void closeOrder(Integer hour);
}
